﻿using Mozi.HttpEmbedded.Generic;

namespace Mozi.Live.RTP
{
    /// <summary>
    /// RTCP数据包类型
    /// </summary>
    public class RTCPPackageType : AbsClassEnum
    {
        private string _name = "";
        private byte _typeValue;
        /// <summary>
        /// 包类型 SR Sender Report
        /// </summary>
        public static RTCPPackageType SenderReport = new RTCPPackageType("SR", 200);
        /// <summary>
        /// 包类型 RR Receiver Report
        /// </summary>
        public static RTCPPackageType ReceiverReport = new RTCPPackageType("RR", 201);
        /// <summary>
        /// 包类型 SDES Source Description
        /// </summary>
        public static RTCPPackageType SourceDescription = new RTCPPackageType("SDES", 202);
        /// <summary>
        /// 包类型 BYE Bye
        /// </summary>
        public static RTCPPackageType Goodbye = new RTCPPackageType("BYE", 203);
        /// <summary>
        /// 包类型 APP APP
        /// </summary>
        public static RTCPPackageType APP = new RTCPPackageType("APP", 204);
        /// <summary>
        /// 消息类型值
        /// </summary>
        public byte Value
        {
            get
            {
                return _typeValue;
            }
        }
        /// <summary>
        /// 消息类型名
        /// </summary>
        public string Name
        {
            get { return _name; }
        }
        /// <summary>
        /// 唯一标识符号
        /// </summary>
        protected override string Tag
        {
            get
            {
                return _typeValue.ToString();
            }
        }

        internal RTCPPackageType(string name, byte typeValue)
        {
            _name = name;
            _typeValue = typeValue;
        }
    }
}
